package com.bc.bcmodel.req;

import com.bc.bcmodel.Entity;
import com.bc.commoncore.util.DataUtils;
import com.bc.commoncore.util.StringUtils;
import com.bc.commonentity.enums.HttpReturnRnums;

/**
 * Created by lianzerong on 2018/8/23.
 */
public class UserRestPasswdReq extends Entity {
    private static final long serialVersionUID = 6625889754025315262L;
    private String code;
    private String passWd;//注册密码
    private String passWdRep;//注册密码重复

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getPassWd() {
        return passWd;
    }

    public void setPassWd(String passWd) {
        this.passWd = passWd;
    }

    public String getPassWdRep() {
        return passWdRep;
    }

    public void setPassWdRep(String passWdRep) {
        this.passWdRep = passWdRep;
    }

    public HttpReturnRnums paramsCheck() {
        if (StringUtils.isEmpty(getCode())) {
            return HttpReturnRnums.ParaError;
        }
        if (StringUtils.isEmpty(getPassWd())) {
            return HttpReturnRnums.PASSWD_IS_EMPTY;
        }
        if (StringUtils.isEmpty(getPassWdRep())) {
            return HttpReturnRnums.PASSWDREP_IS_EMPTY;
        }
        if (!StringUtils.equals(getPassWd(), getPassWdRep())) {
            return HttpReturnRnums.PASSWD_NOT_EQUAL;
        }
        return HttpReturnRnums.Success;
    }
}
